<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
</head>
<body>
    <div>
        <form action="#" id="myform" method="post" name="myform" >
            <p>登录休闲网</p>
            <p><span>Email：</span><input type="text" class="inputs" /></p>
            <p><span>密码：</span><input type="password" class="inputs" /></p>
            <p><input name="btn" id="btn" type="submit" value="登录" class="rb1"  /></p>
        </form>
    </div>
    <script  src="js/jquery-1.12.4.js"></script>
    <script>
        $(document).ready(function(){
            $("form").submit(function(){
                var mail = $("#myform :text").val();
                if (mail=="") {//检测Email是否为空
                    alert("Email不能为空");
                    return false;
                }
                if (mail.indexOf("@") == -1) {
                    alert("Email格式不正确\n必须包含@");
                    return false;
                }
                if (mail.indexOf(".") == -1) {
                    alert("Email格式不正确\n必须包含.");
                    return false;
                }
                return true;
            })
        })
    </script>
</body>
</html>

